<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
	<link rel="stylesheet"  type="text/css"  href="<%=request.getContextPath() %>/resources/css/back/user.css">
</head>
<body>
<h1>用户列表</h1><br>
	<div class="input-group search">
		<input type="text"  placeholder="请输入用户名" id="searchuserval">
		<button class="btn btn-primary" id="searchuser">搜索&nbsp;&nbsp;<span class="glyphicon glyphicon-search"></span></button>
	</div>
	<br>
	
<div class="table-responsive">
	<table class="table table-striped table-hover table-bordered ">
		<thead>
			<tr class="info">
				<td>用户名</td>
				<td>密码</td>
				<td>邮箱</td>
				<td>手机号</td>
				<td>密码问题</td>
				<td>答案</td>
				<td>角色</td>
				<td>创建时间</td>
				<td>操作</td>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${userlist }" var="user">
			<tr>
				<td>${user.username }</td>
				<td>${user.password}</td>
				<td>${user.email}</td>
				<td>${user.phone }</td>
				<td>${user.question}</td>
				<td>${user.answer }</td>
				<c:if test="${user.role eq 1}"><td>青铜会员</td></c:if>
				<c:if test="${user.role eq 2}"><td>白银会员</td></c:if>				
				<td>${user.createTime }</td>
				<td><button class="btn btn-primary">设置权限</button></td>
			</tr>
			</c:forEach>
		</tbody>
	</table>
</div>
	<span class="col-md-7 col-sm-4"></span>
		 <ul class="pager col-md-5 col-sm-8">
			 <li>共${page.pages }页，当前第${page.pageNum }页</li>
			 <li><a href="JavaScript:void()" onclick="showRight('<%=request.getContextPath() %>/userlist','id','${page.firstPage}')">首页</a></li>
			 <li><a href="JavaScript:void()" onclick="showRight('<%=request.getContextPath() %>/userlist','id','${page.prePage}')">上一页</a></li>
			 <li><a href="JavaScript:void()" onclick="showRight('<%=request.getContextPath() %>/userlist','id','${page.nextPage}')">下一页</a></li>
			 <li><a href="JavaScript:void()" onclick="showRight('<%=request.getContextPath() %>/userlist','id','${page.lastPage}')">尾页</a></li>
		 </ul>
	
<script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/back/user.js"></script>
</body>
</html>